package com.ruoyi.basicsys.service.impl;

import java.util.List;

import com.ruoyi.pojo.constant.RConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.basicsys.mapper.BasicHouseholdMapper;
import com.ruoyi.basicsys.domain.BasicHousehold;
import com.ruoyi.basicsys.service.IBasicHouseholdService;

/**
 * 住户管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-25
 */
@Service
public class BasicHouseholdServiceImpl implements IBasicHouseholdService 
{
    @Autowired
    private BasicHouseholdMapper basicHouseholdMapper;

    /**
     * 查询住户管理
     * 
     * @param id 住户管理主键
     * @return 住户管理
     */
    @Override
    public BasicHousehold selectBasicHouseholdById(Long id)
    {
        return basicHouseholdMapper.selectBasicHouseholdById(id);
    }

    /**
     * 查询住户管理列表
     * 
     * @param basicHousehold 住户管理
     * @return 住户管理
     */
    @Override
    public List<BasicHousehold> selectBasicHouseholdList(BasicHousehold basicHousehold)
    {

        return basicHouseholdMapper.selectBasicHouseholdList(basicHousehold);
    }

    /**
     * 新增住户管理
     * 
     * @param basicHousehold 住户管理
     * @return 结果
     */
    @Override
    public int insertBasicHousehold(BasicHousehold basicHousehold)
    {

        //住户的状态默认设置为正常 即为1
        basicHousehold.setNucleicAcidStatus(RConst.Num.LONG_1);
        return basicHouseholdMapper.insertBasicHousehold(basicHousehold);
    }

    /**
     * 修改住户管理
     * 
     * @param basicHousehold 住户管理
     * @return 结果
     */
    @Override
    public int updateBasicHousehold(BasicHousehold basicHousehold)
    {
        return basicHouseholdMapper.updateBasicHousehold(basicHousehold);
    }

    /**
     * 批量删除住户管理
     * 
     * @param ids 需要删除的住户管理主键
     * @return 结果
     */
    @Override
    public int deleteBasicHouseholdByIds(Long[] ids)
    {
        return basicHouseholdMapper.deleteBasicHouseholdByIds(ids);
    }

    /**
     * 删除住户管理信息
     * 
     * @param id 住户管理主键
     * @return 结果
     */
    @Override
    public int deleteBasicHouseholdById(Long id)
    {
        return basicHouseholdMapper.deleteBasicHouseholdById(id);
    }

    @Override
    public List<BasicHousehold> selectTaskPeople() {
       return basicHouseholdMapper.selectTaskPeople();
    }

    @Override
    public List<BasicHousehold> selectHouseholdList(BasicHousehold b) {
        return basicHouseholdMapper.selectHouseholdList(b);
    }


}
